<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/pages/home/callCenter.css"/>
		<title></title>
	</head>
	<body>
		
		<div id="call">
			<div class="list">
				<div class="item" v-for="(item, index) in listCalls" :key="index" @click="onPone(item)">
					<span class="title" v-text="item.serName"></span>
					<span class="icon">
						<img src="../neighbor/images/details/ipone.png" alt="">
					</span>
				</div>
			</div>
		</div>
		
		<script src="../../js/Width.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/Util.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
		<script type="text/javascript">
			mui.init()
			mui.plusReady(function(){
				if (!mui.os.android) {
					FastClick.attach(document.body);
				}
				var self = plus.webview.currentWebview();
				self.setStyle({
					titleNView: {
						titleText: "物业客服电话",
						backgroundColor: "#FFFFFF",
						autoBackButton: true
					}
				})
				getServiceTel()
			})
			
			function getServiceTel() {
				mui.post(Util.HTTP + 'api/Repairs/GetServiceTel',{},function(res){
					if(res.code==1001){
						call.listCalls = res.data
					} else {
						mui.toast(res.message)
					}
				})
			}
			
			var call = new Vue({
				el: '#call',
				data:{
					listCalls: []
				},
				methods: {
					onPone(item){
						plus.nativeUI.confirm("您要给" + item.serName + "打电话吗？", function (e) {
							if (e.index == 0) {
								plus.device.dial(item.serPhone, false);
							}
						})
					}
				}
			})
		</script>
	</body>
</html>
